package Message.Game
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;
    import flash.utils.*;

    public class SPetInfo extends Object implements IMessageBase
    {
        public var code:int;
        public var changeCode:int;
        public var uid:String;
        public var name:String;
        public var typeName:String;
        public var life:int;
        public var mana:int;
        public var level:int;
        public var experience:Number;
        public var lifeSpan:int;
        public var energy:int;
        public var maxEnergy:int;
        public var maxLifeSpan:int;
        public var sex:int;
        public var needLevel:int;
        public var gene:int;
        public var career:int;
        public var growth:int;
        public var spirit:int;
        public var talent:int;
        public var status:int;
        public var icon:String;
        public var crit:int;
        public var sireTime:int;
        public var maxSkillAmount:int;
        public var growthBless:int;
        public var spiritBless:int;
        public var fightAttribute:SFightAttribute;
        public var items:Array;
        public var dictIntStr:Dictionary;
        public var skills:Array;
        public const _type:int = 12043;
        public static var _regist:SPetInfo = new SPetInfo(true);

        public function SPetInfo(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            
        }

        public function getType() : int
        {
            return this._type;
        }

        public function clone() : IMessageBase
        {
            return new SPetInfo();
        }

        public function __write(param1:SerializeStream) : void
        {
            param1.writeInt(this.code);
            param1.writeInt(this.changeCode);
            param1.writeString(this.uid);
            param1.writeString(this.name);
            param1.writeString(this.typeName);
            param1.writeInt(this.life);
            param1.writeInt(this.mana);
            param1.writeInt(this.level);
            param1.writeLong(this.experience);
            param1.writeInt(this.lifeSpan);
            param1.writeInt(this.energy);
            param1.writeInt(this.maxEnergy);
            param1.writeInt(this.maxLifeSpan);
            param1.writeInt(this.sex);
            param1.writeInt(this.needLevel);
            param1.writeInt(this.gene);
            param1.writeInt(this.career);
            param1.writeInt(this.growth);
            param1.writeInt(this.spirit);
            param1.writeInt(this.talent);
            param1.writeInt(this.status);
            param1.writeString(this.icon);
            param1.writeInt(this.crit);
            param1.writeInt(this.sireTime);
            param1.writeInt(this.maxSkillAmount);
            param1.writeInt(this.growthBless);
            param1.writeInt(this.spiritBless);
            this.fightAttribute.__write(param1);
            SeqPlayerItemHelper.write(param1, this.items);
            DictIntStrHelper.write(param1, this.dictIntStr);
            SeqSPetSkillHelper.write(param1, this.skills);
            
        }

        public function __read(param1:SerializeStream) : void
        {
            this.code = param1.readInt();
            this.changeCode = param1.readInt();
            this.uid = param1.readString();
            this.name = param1.readString();
            this.typeName = param1.readString();
            this.life = param1.readInt();
            this.mana = param1.readInt();
            this.level = param1.readInt();
            this.experience = param1.readLong();
            this.lifeSpan = param1.readInt();
            this.energy = param1.readInt();
            this.maxEnergy = param1.readInt();
            this.maxLifeSpan = param1.readInt();
            this.sex = param1.readInt();
            this.needLevel = param1.readInt();
            this.gene = param1.readInt();
            this.career = param1.readInt();
            this.growth = param1.readInt();
            this.spirit = param1.readInt();
            this.talent = param1.readInt();
            this.status = param1.readInt();
            this.icon = param1.readString();
            this.crit = param1.readInt();
            this.sireTime = param1.readInt();
            this.maxSkillAmount = param1.readInt();
            this.growthBless = param1.readInt();
            this.spiritBless = param1.readInt();
            this.fightAttribute = new SFightAttribute();
            this.fightAttribute.__read(param1);
            this.items = SeqPlayerItemHelper.read(param1);
            this.dictIntStr = DictIntStrHelper.read(param1);
            this.skills = SeqSPetSkillHelper.read(param1);
            
        }

    }
}
